package cn.dnui_zjs008.dnuifood_madp003.controller;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import cn.dnui_zjs008.dnuifood_madp003.R;
import cn.dnui_zjs008.dnuifood_madp003.bean.UserBean;
import cn.dnui_zjs008.dnuifood_madp003.listener.onRetrofitListener;
import cn.dnui_zjs008.dnuifood_madp003.model.UserModel;

public class LoginActivity extends BaseActivity
 implements onRetrofitListener<UserBean>,
        View.OnClickListener{
    private UserModel model;
    private Button btn_login;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }



    @Override
    void initViews() {
        layout_file=R.layout.activity_login;
        setLayout(layout_file);
        btn_login = findViewById(R.id.btn_login);

    }

    @Override
    void initEvents() {
        btn_login.setOnClickListener(this);
    }

    @Override
    void initDatas() {

    }
    @Override
    public void onSuccess(UserBean object,int flag) {
        switch (flag){
            case 1:
                break;
                default:

        }

    }

    @Override
    public void onFalure(String msg) {

    }
    @Override
    public void onClick(View view) {
        model = new UserModel();
        model.login("1","1",this);
    }
}
